package com.googlecode.bip.xml.export;

import java.io.IOException;

/**
 * Handle XML export from MySQL database
 */
//not public
class XMLValueDescriptions  implements XMLAppender
{
    private static final long serialVersionUID = 1L;
    private int value;
    private String valuedescription;

    public XMLValueDescriptions(
            final int       value,
            final String    valuedescription
            )
    {
        this.value = value;
        this.valuedescription = valuedescription;
    }

    /**
     * <XMP>
     * <!ELEMENT valuedescriptions (value,valuedescription)>
     * <!ELEMENT value             (#PCDATA)>
     * <!ELEMENT valuedescription  (#PCDATA)>
     * </XMP>
     */
    @Override
    public void appendXML( Appendable a ) throws IOException
    {
        a.append( "<valuedescriptions>\n" );

        XMLAppenderHelper.appendXMLValue( a, "value", value );
        XMLAppenderHelper.appendXMLValue( a, "valuedescription", valuedescription );

        a.append( "</valuedescriptions>\n" );
    }

}
